<!-- 驿站管理 -->
<template>
	<view class="ColonelStation">
		<view v-if="list.length && !loading">
			<view class="colonel f-background radius20 margin-bottom-20" v-for="(item,index) in list" :key="index"
				@click="onJumpPage(item.id)">
				<view class="dis-cen">
					<view class="dis-ali size-30 color9">
						<view class="colonel-title">驿站名称</view>
						<view class="color3">{{item.siteName}}</view>
					</view>
					<text class="iconfont icon-yizhanbianji"></text>
				</view>
				<view class="flex size-30 color9">
					<view class="colonel-title">驿站地址</view>
					<view class="color3 width-title">{{item.siteAddress}}{{item.siteAddressDetails}}</view>
				</view>
				<view class="dis-ali size-30 color9">
					<view class="colonel-title">服务时间</view>
					<view class="color3">{{item.startTime}}-{{item.endTime}}</view>
				</view>
			</view>
		</view>
		<view class="default" v-if="!list.length && !loading">
			<Default tisName="暂无驿站数据!" />
		</view>
		<view class="inset-bottom"></view>
		<view class="add-goods app-bottom-left f5-background inset-bottom dis">
			<u-button type="primary" @click="onJumpPage" :hoverStartTime="100000"
				:customStyle="{width: '690rpx',height: '96rpx',margin:0, borderRadius: '100rpx'}" color="#EB0000">
				<text class="iconfont icon-jia size-28"></text>
				<text class="color-f font-weight-500 size-34 margin-left-12">添加驿站</text>
			</u-button>
		</view>
	</view>
</template>

<script>
	import Default from "@/components/default/default"
	import { TeamLeaderSite } from "@/api/index"
	export default {
		components: { Default },
		data() {
			return {
				loading: true,
				list: []
				// addsShow: true,
			}
		},
		onShow() {
			this.postTeamLeaderSite()
		},
		methods: {
			// 列表数据
			async postTeamLeaderSite() {
				const { code, data } = await TeamLeaderSite(this.params)
				if (code == "200") {
					this.list = data
					this.loading = false
					console.log('this.list ',this.list.length )
				}
			},
			onJumpPage(id) {
				let urlData = '/packageColonel/station/add-station'
				if (id) urlData = `${urlData}?id=${id}`
				uni.navigateTo({
					url: urlData
				});
			}
		}
	}
</script>

<style lang="scss">
	.ColonelStation {
		padding: 20rpx 20rpx 168rpx;

		.colonel {
			padding: 26rpx;
			display: grid;
			grid-gap: 18rpx;

			.colonel-title {
				width: 160rpx;
			}

			.width-title {
				width: 70%;
			}
		}

		.add-goods {
			height: 168rpx;
			width: 100%;
			position: fixed;
		}
	}
</style>